﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tracking.Data.Model.Interfaces;
using System.Data.Entity;
using System.Security.Cryptography;
using System.IO;
using Tracking.Common.Utils;

namespace Tracking.Data.Model.Implementation
{
    public class UserRepository : IUserRepository
    {
        public User Login(string username, string password)
        {
            var hash = HashUtils.GetHash(password);

            var context = new TrackingModelContainer();
            var user = context.Users.FirstOrDefault(p => p.Username == username && p.Password == hash);
            return user;
        }


    }
}
